package com.cyj.springbootservice.api.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.cyj.springbootservice.api.constant.DateConstants;
import com.cyj.springbootservice.api.entity.enums.AerialMode;
import com.cyj.springbootservice.api.entity.enums.Motion;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @description:
 * @Author C_Y_J
 * @create 2021/10/7 11:44
 **/
@Data
@Accessors(chain = true)
public class Aerial implements Serializable {
    private static final long serialVersionUID = 7742032351870674663L;

    /**
     * 航拍 id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ID_WORKER)
    private Long id;

    /**
     * 航拍名称
     */
    @NotBlank(message = "航拍名称不能为空")
    private String name;

    /**
     * 航拍类型	1:倾斜摄影,	2:建图航拍  3:快易拼
     */
    @NotNull(message = "航拍类型不能为空")
    private AerialMode aerialMode;

    /**
     * 飞行高度
     */
    private Integer flightHeight;

    /**
     * 起飞速度
     */
    private Integer takeoffSpeed;

    /**
     * 航线速度
     */
    private Integer lineSpeed;

    /**
     * 是否高程优化
     */
    private Boolean elevationOptimization;

    /**
     * 动作 0:悬停,1:自动返航,2:原地降落,3:返回航线起始点,4:继续执行
     */
    private Motion completeTheAction;

    /**
     * 旁向重叠率
     */
    private Integer lateralOverlapRatio;

    /**
     * 航向重叠率
     */
    private Integer courseOverlapRate;

    /**
     * 主航线角度
     */
    private Integer mainRouteAngle;

    /**
     * 倾斜角度
     */
    private Integer tiltAngle;

    /**
     * 边距
     */
    private Integer argin;

    /**
     * 图片URL
     */
    private String url;

    /**
     * 位置
     */
    private String address;

    /**
     * 是否删除 0未删除,1删除
     */
    @TableLogic
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateConstants.PATTERN_DATETIME)
    @DateTimeFormat(pattern = DateConstants.PATTERN_DATETIME)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = DateConstants.PATTERN_DATETIME)
    @DateTimeFormat(pattern = DateConstants.PATTERN_DATETIME)
    private LocalDateTime updateTime;
}
